package com.foftact.etfposi;

import com.foftact.Foftact;
import com.foftact.etfposi.mapper.ETFPosiationMapper;
import org.mockito.InjectMocks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.List;

@SpringBootTest(classes= Foftact.class)
public class ETFPosiTestng extends AbstractTestNGSpringContextTests {

//    @Autowired
//    private ETFList2Mapper etfList2Mapper;

    @Autowired
    private ETFPosiationServiceImpl etfPosiationService;

    @Test
    public void test() throws Exception {
//        etfList2Mapper.selectByCode()
        etfPosiationService.fetchAndSaveETFPosiationData("159915");
        List<ETFPosiation> list = etfPosiationService.getETFPosiationByFundCodeAndReportPeriod("159915", 2025, 1);
        Assert.assertTrue(list.size() > 8);
    }

}
